﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

namespace DHYHN.ASPNET.HoiNghi
{
    public partial class WebForm5 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string user= Convert.ToString( Session[Common.Constant.MyUserIDLogin]);
            if (user == "")
            {
                Session[Common.Constant.MyMesage] = "Bạn chư đăng nhập vào hệ thống! Hãy click <a href='Login.aspx'> vào đây </a> để đăng nhập.";
                Response.Redirect("Mesage.aspx");
            }
            
                sangnv21.sqlConnectionstring = ConfigurationManager.ConnectionStrings["HoiNghiConnectionString"].ConnectionString;
                sangnv21.selectQuery = "SELECT tbResports.reportid, tbResports.userid, tbResports.title, tbResports.description, tbResports.docfileURL, tbResports.slidefileURL, tbResports.filesize, tbResports.created, tbResports.status, tbUsers.userid AS Expr1, tbUsers.firstName, tbUsers.lastName, tbUsers.birthday, tbUsers.address FROM tbResports INNER JOIN tbUsers ON tbResports.userid = tbUsers.userid where tbUsers.userid='"+user+"'";
                sangnv21.pageSize = 4;            
              //if (!IsPostBack)
            //{
            //    if (GridView1.Rows.Count == 0)
            //    {
            //        lblError.Visible = true;
            //    }
            //    else
            //        lblError.Visible = false;
            //}
        }

       
        protected void btnNewTop_Click(object sender, EventArgs e)
        {
            Response.Redirect("CauHoi_New.aspx");
        }

        protected void btnImportTop_Click(object sender, EventArgs e)
        {
            Response.Redirect("CauHoi_Import.aspx");
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
        }
    }
}